# -*- coding: utf-8 -*-
"""
Created on Wed Nov 26 14:53:29 2014

@author: revol
"""

class Solve:
    def __init__(self,data=[]):
        """
        variables:
            _name           string.         name of the algorithm 
            _description    string.         or introduction
            _paramenters    list of dicts.  list of data needs to calculate
            _needPlot = false       bool.   if it needs plot function
            _result         string          store the result
            _data           dict.           store the data to calc
                data format example: ['a':100,'b':12.0]
        """
#         self._setTypes()
        self.typeINT='int'
        self.typeFLOAT='float'
        self.typeMATRIX='matrix'
        self.typeBOOL='bool'
        self.typeLIST='list'
        #informations about the algorithm        
        self._name=""
        self._description=""
        self._paramenters=[{'name':'root','type':self.typeFLOAT}]
        self._needPlot=False
        self._data=data
        self._result=None

#     def _setTypes(self):  
#         self.typeINT='int'
#         self.typeFLOAT='float'
#         self.typeMATRIX='matrix'
#         self.typeBOOL='bool'        

    def getParamenters(self):
        return self._paramenters
       
    def getDescription(self):
        return self._description
    
    def getName(self):
        return self._name
    
    def isNeedPlot(self):
        return self.isNeedPlot
        
    def calc(self,data):
        self._data=data

    def checkData(self):
        pass
        
    def getResult(self):
        return self._result
    
    def getOutput(self):
        if not self._result:
            self.calc(self._data)
    
    def plot(self):
        pass
    